﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BattleNet
{
    /// <summary>
    /// 
    /// </summary>
    public static class BattleNet
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="region"></param>
        /// <returns></returns>
        public static Uri GetBaseUriByRegion(Regions region)
        {
            switch (region)
            {
                case Regions.US:
                    {
                        return new Uri("http://us.battle.net/");
                    }
                case Regions.EU:
                    {
                        return new Uri("http://eu.battle.net/");
                    }
                case Regions.KR:
                    {
                        return new Uri("http://kr.battle.net/");
                    }
                case Regions.TW:
                    {
                        return new Uri("http://tw.battle.net/");
                    }
                case Regions.CN:
                    {
                        return new Uri("http://www.battlenet.com.cn/");
                    }
                default:
                    {
                        throw new NotImplementedException();
                    }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="unixTimeStamp"></param>
        /// <returns></returns>
        public static DateTime UnixTimeStampToDateTime(long unixTimeStamp)
        {
            System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            return dtDateTime.AddSeconds(unixTimeStamp).ToLocalTime();
        }
    }
}
